pub fn rotate(input: &str, key: u8) -> String {
    let rot = |ch_val, base| (((ch_val as u8 + key) - base) % 26 + base) as char;

    input
        .chars()
        .into_iter()
        .map(|mut ch| {
            if ch.is_alphabetic() {
                if ch.is_uppercase() {
                    ch = rot(ch, 65);
                } else {
                    ch = rot(ch, 97);
                }
            }
            ch
        })
        .collect()
}

#[test]
#[ignore]
fn rotate_numbers() {
    let text = "Testing 1 2 3 testing";
    let shift_key = 4;
    let output = rotate(text, shift_key);
    let expected = "Xiwxmrk 1 2 3 xiwxmrk";
    assert_eq!(output, expected);
}